#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <math.h>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int removeDuplicates(vector<int>& nums) {
    short size=nums.size();
    if(size==0)return 0;
    short i=0;
    for(short j=1;j<size;j++){
        if(nums[i]!=nums[j]){
            i++;
            nums[i]=nums[j];
        }
    }
    return i+1;
}
int main(){
    vector<int>a={0,0,1,1,1,2,2,3,3,4};

cout<<removeDuplicates(a)<<endl;

for(auto temp:a){
    cout<<temp<<",";
}
    return 0;
}